<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>jQuery 选择器使用特点</title>
  <script type="text/javascript" src="./script/jquery-3.6.0.min.js"></script>
  <script>
    window.onload=function () {
      // var username = document.getElementById("username");
      // alert("username="+username.value)
      var $username = $("#username");
      alert("username="+$username.val())
    }
  </script>
</head>
<body>
用户名 <input type="text" id="username~" name="username" value="韩顺平教育"/>
</body>
</html>